package com.yxh.view;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.yxh.R;

public class TimePickerDialog extends Dialog {

	private TextView mTimePickerTitle;
	private DateSelectorWheelView mDatePicker;
	private Button mOkButton, mCancelButton;

	public TimePickerDialog(Context context) {
		super(context, R.style.MyDialog);
		setContentView(R.layout.view_time_picker);
		mTimePickerTitle = (TextView) findViewById(R.id.time_picker_title);
		mDatePicker = (DateSelectorWheelView) findViewById(R.id.date_picker);
		mOkButton = (Button) findViewById(R.id.ok);
		mCancelButton = (Button) findViewById(R.id.cancel);
		mOkButton.setTag(TimePickerDialog.this);
		mCancelButton.setTag(TimePickerDialog.this);
	}

	public void setDatePickerTitle(String title) {
		mTimePickerTitle.setText(title);
	}

	public void setInitDataPickerTime(String timeStamp) {
		mDatePicker.setInitTimeStamp(timeStamp);
	}

	public String getSelectedDate() {
		return mDatePicker.getSelectedDate();
	}

	public void setOkOnClick(View.OnClickListener listener) {
		mOkButton.setOnClickListener(listener);
	}

	public void setCancleOnClick(View.OnClickListener listener) {
		mCancelButton.setOnClickListener(listener);
	}

}
